﻿<Window x:Class="XmlEditor.Presentation.Views.ShellWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:Properties="clr-namespace:XmlEditor.Presentation.Properties" xmlns:Helpers1="clr-namespace:XmlEditor.Presentation.Helpers" Title="{Binding Title}" Helpers1:WindowSettings.Save="True">
    <Window.Resources>
        <ResourceDictionary Source="/PresentationFramework.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" />
    </Window.Resources>

    <DockPanel>
        <DockPanel.LayoutTransform>
            <ScaleTransform ScaleX="{Binding ZoomService.ActiveZoom}" ScaleY="{Binding ZoomService.ActiveZoom}"/>
        </DockPanel.LayoutTransform>

        <StatusBar DockPanel.Dock="Bottom">
            <StatusBarItem Content="{Binding Status}" Margin="5 0"/>
            <StatusBarItem HorizontalAlignment="Right">
                <StackPanel Orientation="Horizontal">
                    <Label x:Name="label" Content="{x:Static Properties:Resources.ZoomMenu}" Target="{Binding ElementName=zoomBox}" VerticalAlignment="Center" Padding="0" Margin="0"/>
                    <ComboBox x:Name="zoomBox" ItemsSource="{Binding ZoomService.DefaultZooms}" SelectedItem="{Binding ZoomService.ActiveZoom}" Background="{Binding ElementName=label, Path=Background}" 
                              ItemStringFormat="{}{0:0%}" Margin="7,0,0,0" />
                </StackPanel>
            </StatusBarItem>
        </StatusBar>

        <ContentPresenter Content="{Binding ContentView}"/>
    </DockPanel>
    <!--<Window.Resources>
        <Resources:ConvertFilePathToFileName x:Key="convertPath" />
        <DataTemplate x:Key="XsdTemplate">
            <TextBlock Text="{Binding ., Converter={StaticResource convertPath}}" />
        </DataTemplate>
    </Window.Resources>
    <Window.InputBindings>
        <KeyBinding x:Name="openKeyBinding" Modifiers="Control" Key="O"/>
        <KeyBinding x:Name="saveKeyBinding" Modifiers="Control" Key="S"/>
    </Window.InputBindings>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Menu>
            <MenuItem Header="_File">
                <MenuItem Header="New..." ItemsSource="{Binding XsdTypes}" Command="" ItemTemplate="{StaticResource XsdTemplate}">
                    <MenuItem.ItemContainerStyle>
                        <Style>
                            <Setter Property="MenuItem.Command" Value="{Binding RelativeSource={RelativeSource AncestorType=Menu}, Path=DataContext.CreateNewXmlFile}"/>
                            <Setter Property="MenuItem.CommandParameter" Value="{Binding}" />
                        </Style>
                    </MenuItem.ItemContainerStyle>
                </MenuItem>
                <MenuItem Header="_Open..." Command="{Binding OpenCommand}" InputGestureText="Ctrl+O"/>
                <MenuItem Header="_Save..." Command="{Binding SaveCommand}" InputGestureText="Ctrl+S"/>
                <MenuItem Header="_Save as..." Command="{Binding SaveAsCommand}" />
            </MenuItem>
        </Menu>
        <ContentControl Content="{Binding XmlEditorControl}" Grid.Row="1" />
    </Grid>-->
</Window>
